﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Microhard.WeixinMP.Models
{
    public enum WeixinXMLSorting
    { 
        First = 0,
        Last = 99
    }

    public enum XmlValueType
    { 
        StringValue = 0,
        LongValue = 1,
        DynmicValue = 2,
        ListValue = 3
    }

    public class BuildXMLModel
    {
        public WeixinDataAtr DataAttr { set; get; }
        public PropertyInfo Property { set; get; }
    }


    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, AllowMultiple = false)]
    public class WeixinDataAtr : Attribute
    {
        public string MsgType { set; get; }
        public string XmlElement { set; get; }
        public int OrderForBuildXML { set; get; }
        public XmlValueType ValueType { set; get; }
        public bool UsingInResponse { set; get; }

        public WeixinDataAtr(string msgType, string xmlElement, int orderNum, XmlValueType valueType,bool usingInResponse)
        {
            this.MsgType = msgType;
            this.XmlElement = xmlElement;
            this.OrderForBuildXML = orderNum;
            this.ValueType = valueType;
            this.UsingInResponse = usingInResponse;
        }

        public WeixinDataAtr(string xmlElement, int orderNum, XmlValueType valueType, bool usingInResponse)
        {
            this.XmlElement = xmlElement;
            this.OrderForBuildXML = orderNum;
            this.ValueType = valueType;
            this.UsingInResponse = usingInResponse;
        }

        public WeixinDataAtr(int orderNum, XmlValueType valueType, bool usingInResponse)
        {
            this.OrderForBuildXML = orderNum;
            this.ValueType = valueType;
            this.UsingInResponse = usingInResponse;
        }

        public WeixinDataAtr(string xmlElement)
        {
            this.XmlElement = xmlElement;
        }

        public WeixinDataAtr()
        {
        }
    }
}
